package com.weakteam.orderonline.adminconsole.gwt.client.design;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.*;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.*;
import com.weakteam.orderonline.adminconsole.gwt.client.domain.Category;
import com.weakteam.orderonline.adminconsole.gwt.client.util.Requester;
import com.weakteam.orderonline.adminconsole.gwt.client.util.WebContext;
import com.weakteam.orderonline.adminconsole.gwt.client.widget.*;


/**
 * Created by Max on 03.04.2014.
 */
public class Header extends Composite {
    interface HeaderUiBinder extends UiBinder<Widget, Header> { }
    private static HeaderUiBinder uiBinder = GWT.create(HeaderUiBinder.class);

    private static Header instance = null;
    public static Header getInstance() {
        if (instance == null) {
            instance = new Header();
        }
        return instance;
    }

    @UiField  protected Anchor menuPageLink;
    @UiField  protected Anchor placesPageLink;
    @UiField  protected Anchor ordersPageLink;

    private Header() {
        initWidget(uiBinder.createAndBindUi(this));
        this.menuPageLink.setHref(WebContext.getInstance().getRootContext() + "view/menu.jsp");
        this.placesPageLink.setHref(WebContext.getInstance().getRootContext() + "view/places.jsp");
        this.ordersPageLink.setHref(WebContext.getInstance().getRootContext() + "view/orders.jsp");
    }



}
